package com.clouddisk.file.observer;

import com.clouddisk.file.entity.File;
import lombok.Getter;

/**
 * 文件操作事件
 */
@Getter
public class FileOperationEvent {
    private final String operation;
    private final File file;
    private final Long userId;

    public FileOperationEvent(String operation, File file, Long userId) {
        this.operation = operation;
        this.file = file;
        this.userId = userId;
    }

    public static FileOperationEvent upload(File file, Long userId) {
        return new FileOperationEvent("UPLOAD", file, userId);
    }

    public static FileOperationEvent delete(File file, Long userId) {
        return new FileOperationEvent("DELETE", file, userId);
    }

    public static FileOperationEvent download(File file, Long userId) {
        return new FileOperationEvent("DOWNLOAD", file, userId);
    }
} 